//
//  ST_JVDeniedPhotoAuthorizationView.swift
//  btvideo
//
//  Created by mac on 2019/12/6.
//  Copyright © 2019 JarvanZhang. All rights reserved.
//

import UIKit
import SwifterSwift
import SnapKit

class ST_JVDeniedPhotoAuthorizationView: UIView {
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        self.addSubview(info_label)
        self.addSubview(setting_btn)
        info_label.snp.makeConstraints { (make) in
            make.left.equalToSuperview().offset(15)
            make.right.equalToSuperview().offset(-15)
            make.top.equalToSuperview().offset(20)
        }
        
        setting_btn.snp.makeConstraints { (make) in
            make.centerX.equalToSuperview()
            make.top.equalTo(info_label.snp.bottom).offset(10)
            make.width.equalTo(100)
            make.height.equalTo(40)
        }
        
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
//    MARK: - Properties
    fileprivate lazy var info_label : UILabel = {
       let control = UILabel()
        control.text = "请在iPhone的“设置-隐私-照片”选项中，允许 伴心 访问你的手机相册"
        control.numberOfLines = 0
        control.textAlignment = .center
        control.textColor = Color.init(hex: 0x333333)
        return control
    }()
    


    fileprivate lazy var setting_btn:UIButton = {
        
        let control = UIButton()
        control.setTitleForAllStates("打开设置")
        control.setTitleColor(UIColor.blue, for: UIControl.State.normal)
        control.addTarget(self, action: #selector(push_setting), for: UIControl.Event.touchUpInside)
        return control
    }()
    
//    MARK:- Event
    @objc func push_setting(){
        
        PushTianSetting()
        
    }
}
